package com.ryit.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author 狼灵
 */
@RestController
public class ConsumerController {

    private static final String url = "http://nacos-provider";

    @Autowired
    RestTemplate restTemplate;

    @GetMapping("/consumer/{string}")
    public String consumer(@PathVariable String string){
        return restTemplate.getForObject(url+"/provider/"+string,String.class);
    }
}
